package com.app.miwawa.api.eam.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.framework.common.api.entity.CommonEntityUUID;
import org.springframework.format.annotation.DateTimeFormat;

import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 班级关系表，关联课程－教室－老师－学员
 * <p>描述: 教务管理</p>
 * <p>Company: Professional</p>
 * @author chanlong(陈龙)
 * @date 2016年2月3日 上午10:23:00
 * @version 1.0.2016
 */
@Entity @Table(name = "TB_EAM_CLASSES_RELATION")
public class ClassesRelation extends CommonEntityUUID {

	/** serialVersionUID(long):. */
	private static final long serialVersionUID = 5954606981914482634L;

	// 关联目标（room、lesson、teacher、student）
	@Column(name = "target", length = 10, nullable = true)
	private String target;
	
	// 关联目标的主键ID
	@Column(name = "targetid", length = 50, nullable = true)
	private String targetid;
	
	// 班级ID
	@Column(name = "classesid", length = 50, nullable = true)
	private String classesid;
	
	@Temporal(TemporalType.DATE)
	@JsonFormat(pattern="yyyy-MM-dd", timezone="GMT+8")
	@DateTimeFormat(pattern="yyyy-MM-dd")
	@Column(name = "create_date", nullable = true)
	private Date createDate;

	public ClassesRelation() {
		this.createDate = new Date();
	}
	
	public ClassesRelation(String target, String targetid, String classesid) {
		this.target = target;
		this.targetid = targetid;
		this.classesid = classesid;
		this.createDate = new Date();
	}

	public String getTarget() {
		return target;
	}

	public void setTarget(String target) {
		this.target = target;
	}

	public String getTargetid() {
		return targetid;
	}

	public void setTargetid(String targetid) {
		this.targetid = targetid;
	}

	public String getClassesid() {
		return classesid;
	}

	public void setClassesid(String classesid) {
		this.classesid = classesid;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}
}
